<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./CSS/rem.css">
</head>
<body>
    <div class="header">
        <img class="scann" src="https://markdown-1253389072.cos.ap-nanjing.myqcloud.com/202112101716240.png" alt="">
        <div class="search" >
            <img class="zoom" src="https://markdown-1253389072.cos.ap-nanjing.myqcloud.com/202112101716142.png" alt="">
            <div contenteditable="true" style="line-height: 8rem;">开学季有礼，好货5折起</div>
        </div>
        <img class="news" src="https://markdown-1253389072.cos.ap-nanjing.myqcloud.com/202112101716927.png" alt="">
    </div>
</body>
<script>
    function setHtmlFontSize() {
        // 获取客户端宽度
        const clientWidth=document.documentElement.clientWidth||window.innerWidth||document.documentElement.getBoundingClientRect().width;
        // 给html的rem赋值
        document.documentElement.style.fontSize=clientWidth/75+"px";
    }
    window.onresize=setHtmlFontSize;

</script>
</html>